apiready = function(){
seajs.use(['../../V',"../../api","../../jquery","../../app","../../service"],function(V,$api,$,app,service){
	var vm = {
		el: '.container',
	  	data: {
	  		myIncome: '',
				shopId: '',
				bind: ''
	  	},
	  	mounted:function() {
				var that = this
				api.addEventListener({
						name: 'shopIncomeYZC',
				}, function(ret, err){
					console.log("shopIncomeYZC listen")
						that.getTradingMoney();
				});
	  	},
	  	methods:{
				//--获取我的收入页面金额
				getTradingMoney: function(){
					var that = this;
					app.ajax(service['getTradingMoney'],
					{
						data: {
							values: {
								shop_code: this.shopId,
								unionid: $api.getStorage("shop_unionid"),
								yzc_status: 1
							}
						}
					},
					function (res) {
						// var shopCode = res.data.shop_code; // 商店id
						if(res.code){
							alert("错误号码code："+res.code+"\n错误信息："+res.message)
						}else{
							that.myIncome = res.data;
							console.log(JSON.stringify(that.myIncome))
							console.log("查询YZC收入成功!");
						}
					}
					);
				},
				//--打开交易中列表页面
				openTradingList: function(){
					app.openWin('tradingList',{shopId: this.shopId, yzc_status: 1});
				},
				//--打开可提现列表页面
				openWithdrawMoney: function(){
					app.openWin('withdrawMoney',{shopId: this.shopId, yzc_status: 1});
				},
				//--打开结算中列表页面
				openClearingList: function(){
					app.openWin('clearingList',{shopId: this.shopId, yzc_status: 1});
				},
				//--打开已提现列表页面
				openAlreadyList: function(){
					app.openWin('alreadyList',{shopId: this.shopId, yzc_status: 1});
				},
				//--打开收支明细页面
				openShopIncomeDetail: function(){
					app.openWin('shopIncomeDetail',{shopId: this.shopId, yzc_status: 1});
				},
	  	},
	  	created: function(){
				var that = this;
				this.shopId = api.pageParam.shopId
				// this.getTradingMoney();

				api.addEventListener({
				    name: 'backtToShopIncome'
				}, function(ret, err){
					that.getTradingMoney();
				});

			}
	};

	var even = function() {}
	var newVue = new Vue(vm);
	even();
});
}
